<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function jsonp(url, callback) {
            new Promise((resolve, reject) => {
                let script = document.createElement('script')
                script.src = `${url}?callback=${callback}`
                window[callback] = function (data) {
                    document.body.innerHTML = data
                    resolve(data)
                }
                document.body.appendChild(script)
            })
        }
        jsonp('http://127.0.0.1:3000', 'callback')
            .then(data => {
                console.log(data);
            })


    </script>
</body>

</html>